package com.example.fina2202.day06;

public class RecursionDemo01 {
    public static void main(String[] args) {
        int result = f(5);
        System.out.println(result);
    }

    //用于求给定参数的阶乘
    public static int f(int n){
        if (n==1)
            return 1;
        return n*f(n-1);
    }
}
